Skip to content

feat: Add thread pinning#969

Open
Noojuno wants to merge 5 commits intopingdotgg:mainfrom
Noojuno:t3code/pin-thread-to-top
Open

feat: Add thread pinning#969
Noojuno wants to merge 5 commits intopingdotgg:mainfrom
Noojuno:t3code/pin-thread-to-top

Conversation

@Noojuno
Copy link
Contributor

@Noojuno Noojuno commented Mar 12, 2026

What Changed

Closes #698

  • Adds pinned threads.
    • A pinned thread is displayed above the rest of the threads for a project in the sidebar, indicated by a pin icon on the left hand side
  • Adds a right-click context menu action on a thread in the sidebar to pin/unpin a thread

Why

My workflow means that I am often creating lots of small threads, with potentially one larger thread running in the background in case I need to make changes with the full context of the plan. This larger thread was often getting buried by the smaller threads. This thread is also often where I would have my terminal running in dev mode, which would be tricky to find sometimes to cancel it.

UI Changes

image image

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Add thread pinning to sidebar with context menu toggle and persistent storage

  • Adds a pinned boolean field to the Thread type and OrchestrationThread schema, with a default of false for historical events
  • Extends the projection_threads DB table via migration 014_ProjectionThreadsPinned.ts to add a pinned INTEGER NOT NULL DEFAULT 0 column
  • Updates the decider, projector, and projection pipeline to emit and persist pinned on thread.created and handle pinned updates via thread.meta-updated events
  • The Sidebar displays a pin icon on pinned threads, sorts pinned threads above others, and exposes a context menu action that dispatches thread.meta.update with the toggled pin state
  • Behavioral Change: thread sort order in the sidebar changes — pinned threads always appear before unpinned threads regardless of recency

Macroscope summarized fc69425.

@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e0b49bd5-ae04-4c58-94f2-bb992b6b6ee9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Mar 12, 2026
Noojuno added 2 commits March 15, 2026 20:57
- add `pinned` to orchestration contracts, projector, and projection persistence (with migration)
- support `thread.meta.update` pin toggles via sidebar context menu and `mod+shift+p`
- sort sidebar threads with pinned items first and show a pin indicator
Remove mod+shift+p keybinding for thread.togglePinned from contracts,
server defaults, and web handler. Pinning remains available via the
sidebar context menu.
@Noojuno Noojuno force-pushed the t3code/pin-thread-to-top branch from 4d0842f to dc8fed5 Compare March 15, 2026 08:04
Noojuno added 3 commits March 15, 2026 21:07
Use ProjectionThread.mapFields(Struct.assign(...)) for the DB row
schema instead of manually duplicating every field, matching the
pattern used elsewhere in the codebase.
Dead code left over from the rebase — the function was extracted to
MessagesTimeline.tsx on main but the PR's old inline copy survived.
@zortos293
Copy link
Contributor

Useful feature for threads, since they can’t normally be sorted. This way, you can pin them in a project and move important stuff above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pin / unpin threads to keep important conversations at the top

2 participants